let app = new Vue({
    el:'#moth',
    data: {
        admin:{
            admin_name:'',admin_email:'',admin_password:'',password:''
        }
    }
});
$('#bottom_enroll').click(function(){
    $.ajax({
        url:'/index.php?s=api/login/enroll_opinion',
        type:'POST',
        data:app.admin,
        success:function(value){
            console.log(value);
            if(value.status===0){
                window.alert(value.message);
                window.location.href = '/index.php?s=index/login/Login_list'
            }else{
                window.alert(value.message);
            }

        }
    });
    // console.log(app.admin);
    // return false;
});

// 登录
let cdn = new Vue({
    el:'#moth_reg',
    data:{
        admin: {
            admin_email:'',admin_password:'',enroll:''
        }
    }

});

$('#bottom_reg').click(function () {
    $.ajax({
        url: '/index.php?s=api/login/reg',
        type: 'POST',
        data:cdn.admin,
        success:function (value) {
            console.log(value);
            if(value.status ===0){
                console.log(value.date[0]);
                if(value.date[0] <=2){
                    window.location.href = '/index.php?s=index/backstage/backstage_list';
                }else{
                    window.location.href = '/index.php?s=index/homepage/homepage_list';
                }
                // window.alert(value.message);
            }else{
                window.alert(value.message);
            }
        }
    });
});